package com.fashion.model;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * User: keviyang
 * Date: 11-12-20
 * Time: 下午2:55
 */
@Entity
@Table(name = "Administrator")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Administrator implements Serializable {
    private String id;
    private String name;
    private String password;
    private String displayName;
    private String lastLoginIP;
    private Date lastLoginDate;
    private Date createDate;
    private int role;

   /* <option value="0">编辑</option>
    <option value="1">管理员</option>
    <option value="2">资深编辑</option>
    <option value="3">实习编辑</option>
    <option value="4">兼职编辑</option>*/
    private boolean enabled;  // 1启用，0为停用

    @Id
    @Column
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Column
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Column
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Column
    public String getDisplayName() {
        return displayName;
    }

    public void setDisplayName(String displayName) {
        this.displayName = displayName;
    }

    @Column
    public String getLastLoginIP() {
        return lastLoginIP;
    }

    public void setLastLoginIP(String lastLoginIP) {
        this.lastLoginIP = lastLoginIP;
    }

    @Column(name = "lastLoginDateTime")
    public Date getLastLoginDate() {
        return lastLoginDate;
    }

    public void setLastLoginDate(Date lastLoginDate) {
        this.lastLoginDate = lastLoginDate;
    }

    @Column(name = "createDateTime")
    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    @Column
    public int getRole() {
        return role;
    }

    public void setRole(int role) {
        this.role = role;
    }

    @Column
    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }
}
